
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">   
    <title>我的好友</title>

    <!--图标样式-->
    <link rel="stylesheet" type="text/css" href="/assets/mobile_tree/css/bootstrap.min.css"/>

    <!--主要样式-->
    <link rel="stylesheet" type="text/css" href="/assets/mobile_tree/css/style.css"/>

    <script type="text/javascript" src="/assets/mobile_tree/js/jquery-1.7.2.min.js"></script>
	<script>
		$(function () {

			var json = <?php echo json_encode($data , JSON_UNESCAPED_UNICODE);?>;

			function tree(data) {
				for (var i = 0; i < data.length; i++) {
					var data2 = data[i];
					if (data[i].icon == "icon-th") {
						$("#rootUL").append("<li data-name='" + data[i].code + "'><span><i class='" + data[i].icon + "'></i> " + data[i].name + "</span></li>");
					} else {
						var children = $("li[data-name='" + data[i].parentCode + "']").children("ul");
						if (children.length == 0) {
							$("li[data-name='" + data[i].parentCode + "']").append("<ul></ul>")
						}
						$("li[data-name='" + data[i].parentCode + "'] > ul").append(
							"<li data-name='" + data[i].code + "'>" +
							"<span>" +
							"<i class='" + data[i].icon + "'></i> " +
							data[i].name +
							"</span>" +
							"</li>")
					}
					for (var j = 0; j < data[i].child.length; j++) {
						var child = data[i].child[j];
						var children = $("li[data-name='" + child.parentCode + "']").children("ul");
						if (children.length == 0) {
							$("li[data-name='" + child.parentCode + "']").append("<ul></ul>")
						}
						$("li[data-name='" + child.parentCode + "'] > ul").append(
							"<li data-name='" + child.code + "'>" +
							"<span>" +
							"<i class='" + child.icon + "'></i> " +
							child.name +
							"</span>" +
							"</li>")
						var child2 = data[i].child[j].child;
						tree(child2)
					}
					tree(data[i]);
				}

			}
			tree(json)
		});
        $(function () {
            $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', '关闭');
            $('.tree li.parent_li > span').on('click', function (e) {
                var children = $(this).parent('li.parent_li').find(' > ul > li');
                if (children.is(":visible")) {
                    children.hide('fast');
                    $(this).attr('title', '展开').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
                } else {
                    children.show('fast');
                    $(this).attr('title', '关闭').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
                }
                e.stopPropagation();
            });
        });
    </script>


</head>
<body>

<div class="tree " style="padding-bottom:270px">

    <ul id="rootUL">

    </ul>
</div>
<style>
	.tongji{width:100%; height:260px; background:#fff; position:fixed; bottom:0px; z-index:9999;}
	.tongji_title{ width:100%; height:50px; float:left;line-height:50px; text-indent:1rem; font-size:1rem; background:#efefef;}
	.tongji_content{width:100%; float:left;}
	.tongji_content .items{ width:25%; height:70px; border-bottom:1px solid #efefef; float:left;}
	.tongji_content .items span{ display:block; text-align:center; color:#999;font-size:.8rem;}
	.tongji_content .items span.dazi{font-size:1.2rem; margin-top:18px; color:#000}
	.tongji_content .list3{ width:33.3%;}
</style>
<div class="tongji">
	<div class="tongji_title">数据统计</div>
	<div class="tongji_content">
		<div class="items list3">
			<span class="dazi"><?php echo $count['total'];?></span>
			<span>团队成员</span>
		</div>
		<div class="items list3">
			<span class="dazi"><?php echo $count['total_cart'];?></span>
			<span>开卡用户</span>
		</div>
		<div class="items list3">
			<span class="dazi">￥<?php echo $count['total_price'];?></span>
			<span>团队销售额</span>
		</div>
	</div>
	<div class="tongji_content">
		<div class="items list3">
			<span class="dazi"><?php echo $count['today'];?></span>
			<span>今日新增</span>
		</div>
		<div class="items list3">
			<span class="dazi"><?php echo $count['day7'];?></span>
			<span>15日新增</span>
		</div>
		<div class="items list3">
			<span class="dazi"><?php echo $count['day15'];?></span>
			<span>30日新增</span>
		</div>
	</div>
	<div class="tongji_content">
		<div class="items">
			<span class="dazi"><?php echo $count['total_1'];?></span>
			<span>业务员</span>
		</div>
		<div class="items">
			<span class="dazi"><?php echo $count['total_2'];?></span>
			<span>销售经理</span>
		</div>
		<div class="items">
			<span class="dazi"><?php echo $count['total_3'];?></span>
			<span>总经理</span>
		</div>
		<div class="items">
			<span class="dazi"><?php echo $count['total_item'];?></span>
			<span>团队长</span>
		</div>
	</div>
</div>
</body>
</html>